<template >
        <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" rowSelection="multiple" @grid-ready="gridReady" 
      style="height:100%"  class='ag-theme-alpine'
          :defaultColDef="defaultColDef" :rowData="table.dataList" 
          :columnDefs="cfsValue" :localeText="localeTextData"/>
    <!-- <paginationCopys :total="total" show-total show-jumper 
        show-page-size @change="changePage"  @page-size-change="changeSize" 
        style="justify-content: center"  :page-size="pagination.pageSize"
        :current="pagination.page" /> -->
</template>
<script lang="ts">

import { localeText } from '@/api/aggridZw'
import emitter from "@/hooks/useEventBus";
import { onMounted,reactive, ref } from 'vue';
import { usePagination, useTable } from '@/hooks/table';
import { verifyManage } from '@/api/PhysicalSurveyRoom/physicalTestApi';
export default {
    name:'phyMeasurResult',
    components: {  },
    props:{
        searchData:{ 
          type:Object,
          default:() => {}
       } 
    },
    setup(props){
        //  console.log(props.searchData);
        emitter.on("refresh-phyMeasurResult", () => {
            doRefresh();
        });
        const pageData = reactive<{
             pageLoading:boolean,
         }>({
             pageLoading:false
         });
        const doRefresh = async () => {
            pageData.pageLoading = true;
             await verifyManage().getVerifyInfoList({
                 auditState: 1
             }).then(({code,data}:any) => {
                 if (code === 200) {
                     table.handleSuccess(data);
                     gridOption.value.setRowData(data);
                 }
             }).catch(console.log).finally(() => {
                 pageData.pageLoading = false;
             });
        };
           //表格方面
        const gridOption = ref();
        const gridReady = (params:any) => {
          gridOption.value = params.api;
          //调整表格自适应大小
        }
        const defaultColDef = {
            sortable: true,
            resizable: true,
            filter: true,
            flex: 1
        };
        const table = useTable();
        const cfsValue = [
            {
                headerName: "测试类型",
                field: "verifyType",
            },
            {
                headerName: "测试项目",
                field: "verifyProject",
            },
            {
                headerName: "测试方法",
                field: "verifyMethod",
            },
            {
                headerName: "面料测试要求最小值",
                field: "verifyMinNum",
            },
            {
                headerName: "面料测试要求最大值",
                field: "verifyMaxNum",
            },
            {
                headerName: "可选项",
                field: "extandField",
            },
            {
                headerName: "备注",
                field: "remark",
            },
            {
                headerName: "测试结果",
                field: "judgeResult",
            },
            {
                headerName: "评判结果",
                field: "judgeResult",
            },
            {
                headerName: "创建人",
                field: "createName",
            },
            {
                headerName: "创建时间",
                field: "createTime",
            },
        ];

        const localeTextData :any = ref(localeText);

        return {
            localeTextData,
            cfsValue,
            defaultColDef,
            gridReady,
            table
        }
    },
}
</script>
<style lang="less" scoped>
    
</style> 